<!DOCTYPE html>

<html>
<head>
    <title>熊大书城 - 注册</title>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="熊大书城">
    <link href="/style/blue/style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript"  src="/script/jquery.js"></script>
    <script type="text/javascript" src="/script/jquery.i18n.properties-1.0.9.js" ></script>
    <script type="text/javascript" src="/script/jquery.validate.js"></script>
    <script type="text/javascript" src="/script/page_regist.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#submit").click(function (){
                console.log(1111)
                let username = $("#username").val();
                let email = $("#email").val();
                let password = $("#password").val();
                let nickname = $("#nickname").val();
                let tel = $("#tel").val();
                let gender = $("input[name='gender']:checked").val();
                console.log(username);
                console.log(email);
                console.log(password);
                console.log(nickname);
                console.log(tel);
                console.log(gender);
                $.post("/users/register", {loginname: username, email: email, loginpass: password, nickname: nickname, tellphone: tel, gender: gender},
                    function (res) {
                        if (res.status == 200) {
                            alert("恭喜你注册成功");
                            // 使用相对路径或绝对路径，确保路径正确
                            location.href = "/login.html";

                        } else {
                            console.log(21312342)
                            alert("注册失败，请再注册" + res.message);
                            $("#loginname").val('');
                            $("#email").val('');
                            $("#loginpass").val('');
                            $("#nickname").val('');
                            $("#tel").val('');
                            $("input[name='gender']:checked").val('');
                        }
                    });

            })

        });

    </script>



</head>
<body class="loginbody">
<div class="dataEye">
    <div class="loginbox registbox">
        <div class="logo-a">
            <a href="#" title="熊大书城">
                <img src="/style/blue/images/logo_max.png">
                <span class="logoText">熊大书城</span>
            </a>
        </div>
        <div class="login-content reg-content">
            <div class="loginbox-title">
                <h3>注册</h3>
            </div>
            <form id="signupForm" action="" method="post">
                <div class="login-error"></div>
                <div class="row">
                    <label class="field" for="username">用户名</label>
                    <input type="text" value="" class="input-text-user noPic input-click" name="loginname" id="username">
                </div>
                <div class="row">
                    <label class="field" for="email">注册邮箱</label>
                    <input type="text" value="" class="input-text-user noPic input-click" name="email" id="email">
                </div>
                <div class="row">
                    <label class="field" for="password">密码</label>
                    <input type="password" value="" class="input-text-password noPic input-click" name="loginpass" id="password">
                </div>
                <div class="row">
                    <label class="field" for="passwordAgain">确认密码</label>
                    <input type="password" value="" class="input-text-password noPic input-click" id="passwordAgain">
                </div>
                <div class="row">
                    <label class="field" for="nickname">昵称</label>
                    <input type="text" value="" class="input-text-user noPic input-click" name="nickname" id="nickname">
                </div>
                <div class="row">
                    <label class="field" for="tel">电话</label>
                    <input type="text" value="" class="input-text-user noPic input-click" name="tellphone" id="tel">
                </div>
                <div class="row tips">
                    <input type="radio" id="sex1" name="gender" value="男" checked="checked">
                    <label>男</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <input type="radio" id="sex2" name="gender" value="女">
                    <label>女</label>
                </div>
                <div class="row tips">
                    <input type="checkbox" id="checkBox">
                    <label>
                        我已阅读并同意
                        <a href="#">隐私政策、服务条款</a>
                    </label>
                </div>
                <div class="row btnArea">
                    <input type="button" value="注册" class="login-btn-dis" id="submit" disabled="disabled" />
                </div>
            </form>
        </div>
        <div class="go-regist">
            已有帐号,请<a href="/login.jsp" class="link">登录</a>
        </div>
    </div>
</body>
</html>

<!--<html>-->
<!--<head>-->
<!--    <title>熊大书城 - 注册</title>-->
<!--    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">-->
<!--    <meta name="description" content="熊大书城">-->
<!--    <meta charset="UTF-8">-->
<!--    <link href="/style/blue/style.css" rel="stylesheet" type="text/css" />-->
<!--    <script type="text/javascript"  src="/script/jquery.js"></script>-->
<!--    <script type="text/javascript" src="/script/jquery.i18n.properties-1.0.9.js" ></script>-->
<!--    <script type="text/javascript" src="/script/jquery.validate.js"></script>-->
<!--    <script type="text/javascript" src="/script/page_regist.js"></script>-->
<!--    <script type="text/javascript">-->
<!--        $(document).ready(function () {-->
<!--            $("#submit").click(function (){-->
<!--                console.log(1111)-->
<!--                let username = $("#loginname").val();-->
<!--                let email = $("#email").val();-->
<!--                let password = $("#loginpass").val();-->
<!--                let nickname = $("#nickname").val();-->
<!--                let tel = $("#tel").val();-->
<!--                let gender = $("input[name='gender']:checked").val();-->
<!--                $.post("/users/register",{username:username,email:email,password:password,nickname:nickname,tel:tel,gender:gender}-->
<!--                    ,function(res){-->
<!--                        if(res.status == 200){-->
<!--                            alert("恭喜你注册成功");-->
<!--                            location.href = "./login.html";-->
<!--                        }else{-->
<!--                            alert("注册失败，请再注册"+res.message);-->
<!--                            $("#loginname").val('');-->
<!--                            $("#email").val('');-->
<!--                            $("#loginpass").val('');-->
<!--                            $("#nickname").val('');-->
<!--                            $("#tel").val('');-->
<!--                            $("input[name='gender']:checked").val('');-->
<!--                        }-->
<!--                    })-->
<!--            })-->

<!--        });-->

<!--    </script>-->



<!--</head>-->
<!--<body class="loginbody">-->
<!--<div class="dataEye">-->
<!--    <div class="loginbox registbox">-->
<!--        <div class="logo-a">-->
<!--            <a href="#" title="熊大书城">-->
<!--                <img src="/style/blue/images/logo_max.png">-->
<!--                <span class="logoText">熊大书城</span>-->
<!--            </a>-->
<!--        </div>-->
<!--        <div class="login-content reg-content">-->
<!--            <div class="loginbox-title">-->
<!--                <h3>注册</h3>-->
<!--            </div>-->
<!--            <form id="signupForm" action="" method="post">-->
<!--                <div class="login-error"></div>-->
<!--                <div class="row">-->
<!--                    <label class="field" for="username">用户名</label>-->
<!--                    <input type="text" value="" class="input-text-user noPic input-click" name="loginname" id="username">-->
<!--                </div>-->
<!--                <div class="row">-->
<!--                    <label class="field" for="email">注册邮箱</label>-->
<!--                    <input type="text" value="" class="input-text-user noPic input-click" name="email" id="email">-->
<!--                </div>-->
<!--                <div class="row">-->
<!--                    <label class="field" for="password">密码</label>-->
<!--                    <input type="password" value="" class="input-text-password noPic input-click" name="loginpass" id="password">-->
<!--                </div>-->
<!--                <div class="row">-->
<!--                    <label class="field" for="passwordAgain">确认密码</label>-->
<!--                    <input type="password" value="" class="input-text-password noPic input-click" id="passwordAgain">-->
<!--                </div>-->
<!--                <div class="row">-->
<!--                    <label class="field" for="nickname">昵称</label>-->
<!--                    <input type="text" value="" class="input-text-user noPic input-click" name="nickname" id="nickname">-->
<!--                </div>-->
<!--                <div class="row">-->
<!--                    <label class="field" for="tel">电话</label>-->
<!--                    <input type="text" value="" class="input-text-user noPic input-click" name="tellphone" id="tel">-->
<!--                </div>-->
<!--                <div class="row tips">-->
<!--                    <input type="radio" id="sex1" name="gender" value="男" checked="checked">-->
<!--                    <label>男</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->
<!--                    <input type="radio" id="sex2" name="gender" value="女">-->
<!--                    <label>女</label>-->
<!--                </div>-->
<!--                <div class="row tips">-->
<!--                    <input type="checkbox" id="checkBox">-->
<!--                    <label>-->
<!--                        我已阅读并同意-->
<!--                        <a href="#">隐私政策、服务条款</a>-->
<!--                    </label>-->
<!--                </div>-->
<!--                <div class="row btnArea">-->
<!--                    <input type="submit" value="注册" class="login-btn-dis" id="submit" disabled="disabled" />-->
<!--                </div>-->
<!--            </form>-->
<!--        </div>-->
<!--        <div class="go-regist">-->
<!--            已有帐号,请<a href="/login.jsp" class="link">登录</a>-->
<!--        </div>-->
<!--    </div>-->
<!--</body>-->
<!--</html>-->